package cn.chenhuanming.shh.administer.entity.jpa;

import org.hibernate.annotations.DynamicInsert;

import javax.persistence.*;
import java.time.LocalDateTime;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * HouseQualityApply entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "house_quality_apply", catalog = "house")
@DynamicInsert
public class HouseQualityApply implements java.io.Serializable {

	// Fields

	private Integer id;
	private UserSystem userBrokerByExaminer;
	private House house;
	private UserBroker userBrokerByApplicant;
	private String applyName;
	private LocalDateTime applyTime;
	private String examineStatus;
	private String examineOpinion;
	private String examineName;
	private LocalDateTime examintTime;
	private String status;

	// Constructors

	/** default constructor */
	public HouseQualityApply() {
	}

	/** minimal constructor */
	public HouseQualityApply(House house, UserBroker userBrokerByApplicant,
			String applyName, LocalDateTime applyTime, String examineStatus,
			String status) {
		this.house = house;
		this.userBrokerByApplicant = userBrokerByApplicant;
		this.applyName = applyName;
		this.applyTime = applyTime;
		this.examineStatus = examineStatus;
		this.status = status;
	}

	/** full constructor */
	public HouseQualityApply(UserSystem userBrokerByExaminer, House house,
			UserBroker userBrokerByApplicant, String applyName,
			LocalDateTime applyTime, String examineStatus,
			String examineOpinion, String examineName,
			LocalDateTime examintTime, String status) {
		this.userBrokerByExaminer = userBrokerByExaminer;
		this.house = house;
		this.userBrokerByApplicant = userBrokerByApplicant;
		this.applyName = applyName;
		this.applyTime = applyTime;
		this.examineStatus = examineStatus;
		this.examineOpinion = examineOpinion;
		this.examineName = examineName;
		this.examintTime = examintTime;
		this.status = status;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "examiner")
	public UserSystem getUserBrokerByExaminer() {
		return this.userBrokerByExaminer;
	}

	public void setUserBrokerByExaminer(UserSystem userBrokerByExaminer) {
		this.userBrokerByExaminer = userBrokerByExaminer;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "house_id", nullable = false)
	public House getHouse() {
		return this.house;
	}

	public void setHouse(House house) {
		this.house = house;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "applicant", nullable = false)
	public UserBroker getUserBrokerByApplicant() {
		return this.userBrokerByApplicant;
	}

	public void setUserBrokerByApplicant(UserBroker userBrokerByApplicant) {
		this.userBrokerByApplicant = userBrokerByApplicant;
	}

	@Column(name = "apply_name", nullable = false, length = 20)
	public String getApplyName() {
		return this.applyName;
	}

	public void setApplyName(String applyName) {
		this.applyName = applyName;
	}

	@Column(name = "apply_time", nullable = false, length = 19)
	public LocalDateTime getApplyTime() {
		return this.applyTime;
	}

	public void setApplyTime(LocalDateTime applyTime) {
		this.applyTime = applyTime;
	}

	@Column(name = "examine_status", nullable = false, length = 25)
	public String getExamineStatus() {
		return this.examineStatus;
	}

	public void setExamineStatus(String examineStatus) {
		this.examineStatus = examineStatus;
	}

	@Column(name = "examine_opinion")
	public String getExamineOpinion() {
		return this.examineOpinion;
	}

	public void setExamineOpinion(String examineOpinion) {
		this.examineOpinion = examineOpinion;
	}

	@Column(name = "examine_name", length = 20)
	public String getExamineName() {
		return this.examineName;
	}

	public void setExamineName(String examineName) {
		this.examineName = examineName;
	}

	@Column(name = "examint_time", length = 19)
	public LocalDateTime getExamintTime() {
		return this.examintTime;
	}

	public void setExamintTime(LocalDateTime examintTime) {
		this.examintTime = examintTime;
	}

	@Column(name = "status", nullable = false, length = 3)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

}